/*
 *  composition 0041.cpp
 *  SoundController0002
 *
 *  Created by jiro on 11/10/01.
 *  Copyright 2011 jiro music. All rights reserved.
 *
 */

#include "composition 0041.h"

#include "../Systems/0039/System0039.h"
#include "../Systems/HarmonicSystem/HarmonicSystem.h"

using namespace ::sc::hs;
using namespace ::sc;
using namespace ::sc::system0039;
using namespace std;

namespace sc
{
	void Composition0041::Compose( const std::string& path )
	{
		int repeatCount = 11;
		double dynamics = Note::piano;
		double dynamicsMute = 0.0;
		Sound::WaveType waveType = Sound::SingleSineWave;

		//	028
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample028.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D6, 1.0, Note::G4, 3.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		return;

		//	027
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample027";
			std::vector< ConcreteLine > lines( partCount );

			AbstractRegion region;
			AbstractLine line;
			line.AddNote( AbstractNote( Note::D1, Note::D5, dynamics ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}

		//	026
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample026";
			std::vector< ConcreteLine > lines( partCount );

			AbstractRegion region;
			AbstractLine line;
			line.AddNote( AbstractNote( Note::D1, Note::B4, dynamics ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, 2 * repeatCount );
		}

		//	025
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample025";
			std::vector< ConcreteLine > lines( partCount );

			AbstractRegion region;
			AbstractLine line;
			line.AddNote( AbstractNote( Note::GSharp0, Note::B4, dynamics ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}

		//	024
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample024";
			std::vector< ConcreteLine > lines( partCount );

			AbstractRegion region;
			AbstractLine line;
			line.AddNote( AbstractNote( Note::GSharp0, Note::B2, dynamics ) );
			line.AddNote( AbstractNote( Note::GSharp0, Note::D3, dynamics ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}

		//	023
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample023.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B4, 1.0, Note::DSharp1, 12.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D5, 1.0, Note::DSharp1, 16.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

//		return;

		//	022
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample022.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B3, 1.0, Note::DSharp1, 6.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D4, 1.0, Note::DSharp1, 8.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

//		return;

		//	021
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample021.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B2, 1.0, Note::DSharp1, 3.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D3, 1.0, Note::DSharp1, 4.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			time = 0.0;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B3, 1.0, Note::DSharp1, 6.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D4, 1.0, Note::DSharp1, 8.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, 2 * repeatCount );

			recorder.OutputAudioFile( s );
		}

//		return;

		//	001b-5
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample001b-5.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B2, 1.0, Note::DSharp1, 3.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D3, 1.0, Note::DSharp1, 4.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, 2 * repeatCount );

			recorder.OutputAudioFile( s );
		}

		return;

		//	020
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample020.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::E1, 1.0, Note::D1, 1.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::DSharp1, 1.0, Note::D1, 1.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			time = 0.0;
			lines[ 0 ].clear(); 
			region.clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::E2, 1.0, Note::D1, 2.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::DSharp2, 1.0, Note::D1, 2.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, 2 * repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	019
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample019.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::E1, 1.0, Note::D1, 1.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::DSharp1, 1.0, Note::D1, 1.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	018
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample018";
			std::vector< ConcreteLine > lines( partCount );

			AbstractRegion region;
			AbstractLine line;
			line.AddNote( AbstractNote( Note::D1, Note::E2, dynamics ) );
			line.AddNote( AbstractNote( Note::D1, Note::DSharp2, dynamics ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}

		//	017
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample017.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::E2, 1.0, Note::D1, 2.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::DSharp2, 1.0, Note::D1, 2.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	016
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample016.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::E2, 1.0, Note::D1, 2.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::DSharp3, 1.0, Note::D1, 4.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );
			
			recorder.OutputAudioFile( s );
		}

		//	015
		{
			repeatCount = 20;
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample015.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B4, 1.0, Note::D1, 12.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D3, 1.0, Note::DSharp1, 16.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B5, 1.0, Note::D1, 24.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D4, 1.0, Note::DSharp1, 32.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	exp 014
		{
			repeatCount = 5;
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample014.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B3, 1.0, Note::D1, 6.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D4, 1.0, Note::DSharp1, 8.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );
			
			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B4, 1.0, Note::D1, 12.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D3, 1.0, Note::DSharp1, 16.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B5, 1.0, Note::D1, 24.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D4, 1.0, Note::DSharp1, 32.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	exp 013
		{
			repeatCount = 5;
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample013.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B3, 1.0, Note::D1, 6.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D4, 1.0, Note::DSharp1, 8.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );
			
			time = 0.0;
			repeatCount *= 2;
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::B4, 1.0, Note::D1, 12.0 ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, dynamics, Note::D3, 1.0, Note::DSharp1, 16.0 ) );
			region.push_back( lines[ 0 ] );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}
		
		//	exp 007
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample007.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;
			
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::E3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::E3, 1, dynamics, waveType, Note::D1, 4.0, dynamics ) );
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::E3, 1, dynamics, waveType, Note::D1, 4.0, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			repeatCount = 11;
			region.clear();
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 6, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::D4, 1, dynamics, waveType, Note::DSharp1, 8, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			region.clear();
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 7, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	exp 008
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample008.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;
			double duration;

			repeatCount = 13;
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::E2, 1, dynamics, waveType, Note::D1, 2.0, dynamics ) );
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::E2, 1, dynamics, waveType, Note::D1, 2.0, dynamics ) );
			region.push_back( lines[ 1 ] );
			region.push_back( lines[ 2 ] );
			System0039::Record( recorder, time, region, repeatCount );

			duration = repeatCount * region.GetDuration();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::F4, 1, dynamics, waveType, Note::D1, 10.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::D4, 1, dynamics, waveType, Note::DSharp1, 8.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 6.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::D4, 1, dynamics, waveType, Note::DSharp1, 8.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 6.0, dynamics ) );
			region.clear();
			region.AddLines( lines );
			repeatCount = duration / region.GetDuration();
			
			time = 0.0;
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	exp 009
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample009.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;
			
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::E3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::E3, 1, dynamics, waveType, Note::D1, 4.0, dynamics ) );
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::E3, 1, dynamics, waveType, Note::D1, 4.0, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			repeatCount = 11;
			region.clear();
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 6, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::D4, 1, dynamics, waveType, Note::DSharp1, 8, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			region.clear();
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 7, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	exp 010
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample010.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;
			double duration;

			repeatCount = 13;
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::E2, 1, dynamics, waveType, Note::D1, 2.0, dynamics ) );
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::E2, 1, dynamics, waveType, Note::D1, 2.0, dynamics ) );
			region.push_back( lines[ 1 ] );
			region.push_back( lines[ 2 ] );
			System0039::Record( recorder, time, region, repeatCount );

			duration = repeatCount * region.GetDuration();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::F4, 1, dynamics, waveType, Note::D1, 10.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::D4, 1, dynamics, waveType, Note::DSharp1, 8.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 6.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::D4, 1, dynamics, waveType, Note::DSharp1, 8.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 6.0, dynamics ) );
			region.clear();
			region.AddLines( lines );
			repeatCount = duration / region.GetDuration();
			
			time = 0.0;
			System0039::Record( recorder, time, region, repeatCount );

			recorder.OutputAudioFile( s );
		}

		//	exp 011
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample011.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			repeatCount = 13;
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::E3, 1, dynamics, waveType, Note::D1, 4.0, dynamics ) );
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::E3, 1, dynamics, waveType, Note::D1, 4.0, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			region.clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 6.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::D4, 1, dynamics, waveType, Note::DSharp1, 8.0, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			double startTime = time;
			repeatCount = 1;
			region.clear();
			lines[ 1 ].clear();
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::ASharp3, 1, dynamics, waveType, Note::DSharp1, 6.0, dynamics ) );
			region.push_back( lines[ 1 ] );
			System0039::Record( recorder, startTime, region, repeatCount );
			double duration = region.GetDuration();

			startTime = time;
			region.clear();
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 7.0, dynamics ) );
			region.push_back( lines[ 0 ] );
			repeatCount = duration / lines[ 0 ].GetDuration();
			System0039::Record( recorder, startTime, region, repeatCount );

			startTime = time;
			region.clear();
			lines[ 2 ].clear();
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamics, waveType, Note::D1, 4.0, dynamics ) );
			region.push_back( lines[ 2 ] );
			repeatCount = duration / lines[ 2 ].GetDuration();
			System0039::Record( recorder, startTime, region, repeatCount );

			recorder.OutputAudioFile( s );

		}

		//	exp 012
		{
			AudioRecorder32 recorder( 2, 1 );
			const int partCount = 3;
			string s = path + "exsample012.wav";
			ConcreteRegion region;
			std::vector< ConcreteLine > lines( partCount );
			double time = 0.0;

			repeatCount = 13;
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::E2, 1, dynamics, waveType, Note::D1, 2.0, dynamics ) );
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamicsMute, waveType, Note::D1, 4.0, dynamicsMute ) );
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::E2, 1, dynamics, waveType, Note::D1, 2.0, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			region.clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 6.0, dynamics ) );
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::D4, 1, dynamics, waveType, Note::DSharp1, 8.0, dynamics ) );
			region.AddLines( lines );
			System0039::Record( recorder, time, region, repeatCount );

			double startTime = time;
			repeatCount = 1;
			region.clear();
			lines[ 1 ].clear();
			lines[ 1 ].push_back( ConcreteNote( waveType, Note::ASharp3, 1, dynamics, waveType, Note::DSharp1, 6.0, dynamics ) );
			region.push_back( lines[ 1 ] );
			System0039::Record( recorder, startTime, region, repeatCount );
			double duration = region.GetDuration();

			startTime = time;
			region.clear();
			lines[ 0 ].clear();
			lines[ 0 ].push_back( ConcreteNote( waveType, Note::B3, 1, dynamics, waveType, Note::D1, 7.0, dynamics ) );
			region.push_back( lines[ 0 ] );
			repeatCount = duration / lines[ 0 ].GetDuration();
			System0039::Record( recorder, startTime, region, repeatCount );

			startTime = time;
			region.clear();
			lines[ 2 ].clear();
			lines[ 2 ].push_back( ConcreteNote( waveType, Note::DSharp3, 1, dynamics, waveType, Note::D1, 4.0, dynamics ) );
			region.push_back( lines[ 2 ] );
			repeatCount = duration / lines[ 2 ].GetDuration();
			System0039::Record( recorder, startTime, region, repeatCount );

			recorder.OutputAudioFile( s );

		}

//		return;

		repeatCount = 8;
		//	exsample 001
		{
			string s = path + "exsample001";
			AbstractLine line;
			AbstractRegion region;

			line.AddNote( AbstractNote( Note::D1, Note::B2, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::D1, Note::D3, Note::pianissimo ) );
			region.AddLine( line );
			
			line.Clear();
			line.AddNote( AbstractNote( Note::D1, Note::E2, Note::pianissimo ) );
			region.AddLine( line );

			line.Clear();
			line.AddNote( AbstractNote( Note::DSharp1, Note::DSharp2, Note::pianissimo ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}

		//	exsample 001b
		{
			string s = path + "exsample001b";
			AbstractLine line;
			AbstractRegion region;

			line.AddNote( AbstractNote( Note::DSharp1, Note::B2, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::DSharp1, Note::D3, Note::pianissimo ) );
			region.AddLine( line );

			line.Clear();
			line.AddNote( AbstractNote( Note::DSharp1, Note::E2, Note::pianissimo ) );
			region.AddLine( line );

			line.Clear();
			line.AddNote( AbstractNote( Note::DSharp1, Note::DSharp2, Note::pianissimo ) );
			region.AddLine( line );
			
			System0039::OutputFile( region, s, repeatCount );
		}

		//	002
		{
			string s = path + "exsample002";
			AbstractLine line;
			AbstractRegion region;
			
			line.AddNote( AbstractNote( Note::D1, Note::D3, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::D1, Note::F3, Note::pianissimo ) );
			region.AddLine( line );
			
			line.Clear();
			line.AddNote( AbstractNote( Note::D1, Note::E2, Note::pianissimo ) );
			region.AddLine( line );

			line.Clear();
			line.AddNote( AbstractNote( Note::DSharp1, Note::DSharp2, Note::pianissimo ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}

		//	003
		{
			string s = path + "exsample003";
			AbstractLine line;
			AbstractRegion region;
			
			line.AddNote( AbstractNote( Note::D1, Note::F3, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::D1, Note::GSharp3, Note::pianissimo ) );
			region.AddLine( line );
			
			line.Clear();
			line.AddNote( AbstractNote( Note::D1, Note::E2, Note::pianissimo ) );
			region.AddLine( line );

			line.Clear();
			line.AddNote( AbstractNote( Note::DSharp1, Note::DSharp2, Note::pianissimo ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}
		
		//	004
		{
			string s = path + "exsample004";
			AbstractLine line;
			AbstractRegion region;
			
			line.AddNote( AbstractNote( Note::D1, Note::GSharp3, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::D1, Note::B3, Note::pianissimo ) );
			region.AddLine( line );
			
			line.Clear();
			line.AddNote( AbstractNote( Note::D1, Note::E2, Note::pianissimo ) );
			region.AddLine( line );

			line.Clear();
			line.AddNote( AbstractNote( Note::DSharp1, Note::DSharp2, Note::pianissimo ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}

		//	005
		{
			string s = path + "exsample005";
			AbstractLine line;
			AbstractRegion region;
			
			line.AddNote( AbstractNote( Note::D1, Note::B3, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::D1, Note::D4, Note::pianissimo ) );
			region.AddLine( line );
			
			line.Clear();
			line.AddNote( AbstractNote( Note::D1, Note::E2, Note::pianissimo ) );
			region.AddLine( line );

			line.Clear();
			line.AddNote( AbstractNote( Note::DSharp1, Note::DSharp2, Note::pianissimo ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}

		//	exsample 006
		{
			string s = path + "exsample006";
			AbstractLine line;
			AbstractRegion region;
			
			line.AddNote( AbstractNote( Note::D1, Note::B2, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::D1, Note::D3, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::D1, Note::F3, Note::pianissimo ) );
			line.AddNote( AbstractNote( Note::D1, Note::GSharp3, Note::pianissimo ) );
			region.AddLine( line );
			
			line.Clear();
			line.AddNote( AbstractNote( Note::D1, Note::E2, Note::pianissimo ) );
			region.AddLine( line );

			line.Clear();
			line.AddNote( AbstractNote( Note::DSharp1, Note::DSharp2, Note::pianissimo ) );
			region.AddLine( line );

			System0039::OutputFile( region, s, repeatCount );
		}
	}
}
